import java.util.Scanner;


public class CurrencyConverter
{
   public static void main(String[] args)
   {
      Scanner input = new Scanner(System.in);
      
      
      System.out.println("Enter exchange rate: ");
      double rate = input.nextDouble();
      
      while(true)
      {
         System.out.println("Enter dollar or q to quit: ");
         String line = input.next();
         if (line.equalsIgnoreCase("q"))
         {
            break;
         }
         else
         {
            double dollar = Double.parseDouble(line);
            System.out.println(dollar+" dollars is "+dollar*rate+" euros");
         }
      }
      System.out.println("Goodbye.");
      
   }
   
}
